// ==UserScript==
// @name         获取ItemId的URL
// @namespace 	 test
// @version      1.0.0
// @description  添加购买链接
// @author       Zoro.Zhu
// @include      https://www.dianxiaomi.com/product/edit.htm*
// @exclude      https://www.dianxiaomi.com/product/edit.htm*purchaseUrl*
// @connect      *
// @require      https://code.jquery.com/jquery-2.1.4.min.js
// @grant        window.close
// ==/UserScript==

(function() {
    var sourceUrl10 = $('#sourceUrl0').val();
    if(sourceUrl10 === undefined){
        sourceUrl10 = $('#sourceUrl10').val();
    }
    if(sourceUrl10 != ''){
        var url = window.location.href;
        window.open('http://127.0.0.1/vs/?c=ctrl_wish_product&a=getManuUrl&url=' + encodeURI(sourceUrl10) + '&oldUrl=' + encodeURI(url));
    }
    setTimeout(function(){
        window.close();
    },1000);
})();
